import 'package:core_foundation_example/pages/map/Page_map_home.dart';
import 'package:core_foundation_example/pages/user/page_user_home.dart';
import 'package:flutter/material.dart';
import 'package:core_foundation/widgets/l_tab_bar_widget.dart';
import 'package:core_foundation/widgets/widget_drawer.dart';
///    author : leo
///    e-mail : jkliao@yeah.net
///    date   : 2020-04-03
///    desc   :
class TestPageHome extends StatefulWidget {
  static const rName = "TestPageHome";
  @override
  _TestPageHomeState createState() => _TestPageHomeState();
}

Widget _renderTab(icon, text) {
  return Tab(
    child: Column(
      mainAxisAlignment: MainAxisAlignment.center,
      children: <Widget>[Icon(icon), Text(text)],
    ),
  );
}

class _TestPageHomeState extends State<TestPageHome> with TestPageHomeBLOC {
  List<Widget> tabs = [
    _renderTab(Icons.people, "首页"),
    _renderTab(Icons.map, "地图")
  ];

  @override
  Widget build(BuildContext context) {
    return LTabBarWidget(
      drawer: HomeDrawer(),
      type: TabType.bottom,
      tabItems: tabs,
      tabViews: <Widget>[
        PageUserHome(),
        PageMapHome()
      ],
    );
  }

}

mixin TestPageHomeBLOC {

}
